package com.threeonemeeting.list;

import java.util.ArrayList;
import java.util.List;

import com.threeonemeeting.model.EnrollFieldInfo;

public class EnrollFieldInfoList {

	public int nMeetingId = 0;
	public List<EnrollFieldInfo> listEnrollFieldInfo = new ArrayList<EnrollFieldInfo>();

	public void addEnrollFieldInfo(EnrollFieldInfo info) {
		if (info == null)
			return;

		listEnrollFieldInfo.add(info);
	}

	public int size() {
		return listEnrollFieldInfo.size();
	}

	public EnrollFieldInfo get(int nLocation) {
		return listEnrollFieldInfo.get(nLocation);
	}

	public void clear() {
		listEnrollFieldInfo.clear();
	}

	public EnrollFieldInfo getEnrollFieldInfo(int nMeetingId) {
		for (int i = 0; i < listEnrollFieldInfo.size(); i++) {
			EnrollFieldInfo info = listEnrollFieldInfo.get(i);
			if (info == null)
				continue;

			if (info.nMeetingId == nMeetingId)
				return info;
		}

		return null;
	}
}
